uniform float Rate;
uniform float Pulse;


void main()
{
  float angle = gl_Vertex[2];
  float rate = Rate * gl_Normal[0];
  float pulse = Pulse;
  vec4 newPos;
  
  float rateterm = (rate + 5*angle);
  
  float a = mod((pulse), 40.0);
  float b = mod((pulse+30.0), 40.0);
  float c = mod((rate), 10.0);
  
  
    newPos[0] = gl_Vertex[0] + sin(max(a-20.0, 0.0)/6.36)*(cos(rateterm))* pow(abs(-1.0+abs(angle-5.0)/5.0), 0.3);
    newPos[1] = gl_Vertex[1] + sin(max(a-20.0, 0.0)/6.36)*(sin(rateterm)) * pow(abs(-1.0+abs(angle-5.0)/5.0), 0.3);
    newPos[2] = gl_Vertex[2];
    newPos[3] = gl_Vertex[3];

  vec4 newColor = gl_Color + abs(newPos[1]);
  gl_FrontColor = newColor;//gl_Color;//vec4(1.0,1.0,1.0,1);
  gl_Position = gl_ModelViewProjectionMatrix * newPos;//;newPos;//;
}
